package com.genexususa.eo.bing.test.set;

import com.genexususa.eo.bing.connection.AdGroupManager;
import com.genexususa.eo.bing.test.TestUtil;

public class ConsumeSetAdRotationToAdGroups {
    public static void main(String[] args) {
        TestUtil testUtil = new TestUtil();
        String adGroupAdRotationsRequestsXML =  "<Bing_AdGroupAdRotationsRequestCollection xmlns=\"L2TMediaDev\">\n" +
                                                    "\t<Bing_AdGroupAdRotationsRequest xmlns=\"L2TMediaDev\">\n" +
                                                    "\t\t<GxCampaignId>416149485</GxCampaignId>\n" +
                                                        "\t\t<BingCampaignId>" + testUtil.campaignId1 + "</BingCampaignId>\n" +
                                                        "\t\t<AdGroupAdRotationCollection>\n" +
                                                            "\t\t\t<AdGroupAdRotation>\n" +
                                                                "\t\t\t\t<GxAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">284894561564</GxAdGroupId>\n" +
                                                                "\t\t\t\t<BingAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">" + testUtil.adGroup11 + "</BingAdGroupId>\n" +
                                                                "\t\t\t\t<AdRotation xmlns=\"https://adcenter.microsoft.com/v8\">\n" +
                                                                    //"\t\t\t\t\t<EndDate>2013-05-04T12:05:04</EndDate>\n" +
                                                                    //"\t\t\t\t\t<StartDate>2013-05-03T12:05:04</StartDate>\n" +
                                                                    "\t\t\t\t\t<Type>OptimizeForClicks</Type>\n" +
                                                                "\t\t\t\t</AdRotation>\n" +
                                                            "\t\t\t</AdGroupAdRotation>\n" +
                                                            "\t\t\t<AdGroupAdRotation>\n" +
                                                                "\t\t\t\t<GxAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">284894561564</GxAdGroupId>\n" +
                                                                "\t\t\t\t<BingAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">" + testUtil.adGroup12 + "</BingAdGroupId>\n" +
                                                                "\t\t\t\t<AdRotation xmlns=\"https://adcenter.microsoft.com/v8\">\n" +
                                                                    "\t\t\t\t\t<EndDate>2013-06-08T09:35:00</EndDate>\n" +
                                                                    "\t\t\t\t\t<StartDate>2013-05-01T18:36:05</StartDate>\n" +
                                                                    "\t\t\t\t\t<Type>RotateAdsEvenly</Type>\n" +
                                                                "\t\t\t\t</AdRotation>\n" +
                                                            "\t\t\t</AdGroupAdRotation>\n" +
                                                        "\t\t</AdGroupAdRotationCollection>\n" +
                                                    "\t</Bing_AdGroupAdRotationsRequest>\n" +
                                                    "\t<Bing_AdGroupAdRotationsRequest xmlns=\"L2TMediaDev\">\n" +
                                                        "\t\t<GxCampaignId>416149485</GxCampaignId>\n" +
                                                        "\t\t<BingCampaignId>" + testUtil.campaignId2 + "</BingCampaignId>\n" +
                                                        "\t\t<AdGroupAdRotationCollection>\n" +
                                                            "\t\t\t<AdGroupAdRotation>\n" +
                                                                "\t\t\t\t<GxAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">284894561564</GxAdGroupId>\n" +
                                                                "\t\t\t\t<BingAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">" + testUtil.adGroup21 + "</BingAdGroupId>\n" +
                                                                "\t\t\t\t<AdRotation xmlns=\"https://adcenter.microsoft.com/v8\">\n" +
                                                                    "\t\t\t\t\t<EndDate>2013-04-23T15:45:38</EndDate>\n" +
                                                                    "\t\t\t\t\t<StartDate>2013-03-18T11:10:00</StartDate>\n" +
                                                                    "\t\t\t\t\t<Type>RotateAdsEvenly</Type>\n" +
                                                                "\t\t\t\t</AdRotation>\n" +
                                                                "\t\t\t</AdGroupAdRotation>\n" +
                                                            "\t\t\t<AdGroupAdRotation>\n" +
                                                                "\t\t\t\t<GxAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">284894561564</GxAdGroupId>\n" +
                                                                "\t\t\t\t<BingAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">" + testUtil.adGroup22 + "</BingAdGroupId>\n" +
                                                                "\t\t\t\t<AdRotation xmlns=\"https://adcenter.microsoft.com/v8\">\n" +
                                                                    //"\t\t\t\t\t<EndDate>2013-08-07T07:45:06</EndDate>\n" +
                                                                    //"\t\t\t\t\t<StartDate>2013-07-06T16:43:02</StartDate>\n" +
                                                                    "\t\t\t\t\t<Type>OptimizeForClicks</Type>\n" +
                                                                "\t\t\t\t</AdRotation>\n" +
                                                            "\t\t\t</AdGroupAdRotation>\n" +
                                                        "\t\t</AdGroupAdRotationCollection>\n" +
                                                    "\t</Bing_AdGroupAdRotationsRequest>\n" +
                                                "</Bing_AdGroupAdRotationsRequestCollection>\n";
        AdGroupManager resource = new AdGroupManager();
        System.out.println("Consuming SetAdRotationToAdGroups.....");
        String userName = testUtil.userName;
        String password = testUtil.password;
        String developerToken = testUtil.developerToken;
        long customerId = testUtil.customerId;
        long customerAccountId = testUtil.customerAccountId;
        String applicationId = testUtil.applicationId;
        //String result = resource.setAdRotationToAdGroups(userName, password, developerToken, customerId, customerAccountId, applicationId, adGroupAdRotationsRequestsXML);
        //System.out.println("Result:\n" + result);
    }
}
